package businessLogic;

import businessEntities.TestQueryInformation;
import businessEntities.exceptions.ConnectionException;
import dataAccess.DALQueryTester;

public class BLQueryTester {

    /**
     * Tests where query - SELECT * FROM <code>databaseName</code>.<code>tableName</code> WHERE <code>where</code>
     * @return TestQueryInformation
     */
    public TestQueryInformation testWhereQuery(String databaseName, String tableName, String where) {
        TestQueryInformation result;
        DALQueryTester tester = new DALQueryTester();
        try {
            result = tester.testWhereQuery(databaseName, tableName, where);
        } catch (ConnectionException ex) {
            result = new TestQueryInformation(ex.getMessage(), "", true);
        }

        return result;
    }
}
